package com.qf.test;

import com.qf.dao.UserDao;
import com.qf.pojo.User;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

/*
 *@Description:
 *@author:刘哥
 *@Date:10:01 2022/7/15
 */
@RunWith(SpringRunner.class)
//加载配置文件
@ContextConfiguration("classpath:springmybatis.xml")
public class Demo {
    @Autowired
    UserDao userDao;
    @Test
    public void test(){
        List<User> userList = userDao.findAll();
        for (User user : userList) {
            System.out.println("user = " + user);
        }
    }
}
